<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.msti.entity.Course"%>
<%@page import="com.msti.entity.Student"%>
<%@page import="java.util.Iterator"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h2>Select your courses</h2>
<form action = "StudentDetail2.do" method = "post">


<%
	List<Course> courses = (ArrayList<Course>)request.getAttribute("courses");
	Student student = (Student)request.getAttribute("student");
	//request.getSession().setAttribute("student",student);
	if(courses != null){
	Iterator<Course> iterator = courses.iterator();
	while(iterator.hasNext()){
		Course course = iterator.next();
	%>
<input type="hidden" value="<%=student.getStudentID()%>"/>
<input type="checkbox" name="course" value="<%=course.getId() %>" /> <%=course.getName() %><br />


<%} }
	else{
		response.sendRedirect("errorLogin.jsp");
	}

%>


<input type="submit" value="Send"/>
</form>
</body>
</html>